home *** CD-ROM | disk | FTP | other *** search
- main ()
- {
- long plain [2], crypt [2], cprbuf [2];
-
- /* begin by reading tables and key schedule from files */
- printf ("Reading filed tables and key schedule...\n");
- if (1 != rdfiles ())
- {
- printf ("dodes -- couldn't get tables or key schedule\n");
- exit (1);
- }
-
- printf ("Enter input to encrypt as two hex longs: ");
- scanf ("%lx %lx", &plain [0], &plain [1]);
- des_encrypt (plain, crypt);
- printf ("Encrypted result is: %lx %lx\n", crypt [0], crypt [1]);
- des_decrypt (crypt, cprbuf);
- printf ("Decrypting that result: %lx %lx\n", cprbuf [0], cprbuf [1]);
- }
-
-